package net.wanho.controller;

import net.wanho.vo.AjaxResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@ResponseBody
public class GlobalExceptionHandler {


    @ExceptionHandler(Exception.class)
    public AjaxResult handlerException(Exception e) {
        AjaxResult ajaxResult = new AjaxResult(false, 500, e.getMessage(), null);
        return ajaxResult;

    }
}
